const express = require('express');
const router = express.Router();
const fs = require('fs');
const path = require('path');
const Mock = require('mockjs');
const JSON5 = require('json5');
const bodyParser = require('body-parser');
router.use(bodyParser.json());
router.use(bodyParser.urlencoded({extended: false}));

router.all("*", ((req, res, next) => {
      res.header('Access-Control-Allow-Origin', '*');
      res.header('Access-Control-Allow-Methods', 'PUT, GET, POST, DELETE, OPTIONS');
      res.header("Access-Control-Allow-Headers", "X-Requested-With, Content-Type, Authorization");
      next();
    })
);
//请求基准URI
const baseURL = '/api/private/v1/';
//json基准URL
const dataPath = '../mock/';
//error
const error = dataPath + 'error.json5';

//读取json文件
function getJsonFile(filePath) {
  const jsonStr = fs.readFileSync(path.join(__dirname, filePath), 'utf-8');
  const json = JSON5.parse(jsonStr);
  return json;
}

//在后端进行权限控制
router.use('*', (req, res, next) => {
  if (req.baseUrl.includes('login')) {
    next();
  } else {
    if (req.headers.authorization) {
      next();
    } else {
      res.send('没有权限访问');
    }
  }
});
//返回login数据
const login_url = baseURL + 'login';
const pass_url = dataPath + 'pass.json5';
const login_data = dataPath + 'login.json5';
router.post(login_url, (req, res) => {
  const {username, password} = req.body;
  const json = getJsonFile(login_data);
  const pass = getJsonFile(pass_url);
  if (username === pass.username && password === pass.password) {
    json.success.data.username = username;
    json.success.data.mobile = /^1(?:3\d|4[4-9]|5[0-35-9]|6[67]|7[013-8]|8\d|9\d)\d{8}$/;
    res.json(Mock.mock(json).success);
  } else {
    res.json(Mock.mock(json).fail);
  }
});
router.get(login_url, (req, res) => {
  res.json(getJsonFile(error).methodError);
});

//返回菜单数据
const menu_url = baseURL + 'menus';
const menu_data = dataPath + 'menuList.json5';
router.get(menu_url, (req, res) => {
  res.json(getJsonFile(menu_data));
});

//返回用户列表数据
const users_url = baseURL + 'users';
router.get(users_url, (req, res) => {
  let users = "users|" + req.query.pageSize;
  let data = {
    "data": {
      "total": '',
      "pageNum": req.query.pageNum,
      [users]: [
        {
          "id|+1": 0,
          "username": "@name",
          "mobile": '',
          "type": 1,
          "email": "@email",
          "create_time": "@datetime('yyyy-MM-dd HH:mm:ss')",
          "mg_state|1": true, // 当前用户的状态
          "role_name|1": ["超级管理员", "测试角色2", "主管", "test"]
        }
      ]
    },
    "meta": {
      "msg": "获取成功",
      "status": 200
    }
  };
  data.data["total"] = req.query.pageSize * req.query.pageNum;
  data.data[users][0].mobile = /^1[0-9]{10}$/;
  const queryUsername = req.query.query;
  if (queryUsername) {
    data.data[users][0].username = queryUsername;
  }
  data = Mock.mock(data);
  console.log(data);
  if (req.query.pageSize === '1') {
    data.data['users'] = [data.data['users']];
  }
  console.log(data);
  // res.json(data);
  res.json(data);
});
router.post(users_url, (req, res) => {
  res.json(req.body);
});
router.get(users_url + "/:id", (req, res) => {
  res.json({
    "data": {
      "id": 503,
      "username": "admin3",
      "role_id": 0,
      "mobile": "00000",
      "email": "new@new.com"
    },
    "meta": {
      "msg": "查询成功",
      "status": 200
    }
  });
});
router.put(users_url + "/:id", (req, res) => {
  res.json({
    "data": {
      "id": 503,
      "username": "admin3",
      "role_id": 0,
      "mobile": "111",
      "email": "123@123.com"
    },
    "meta": {
      "msg": "更新成功",
      "status": 200
    }
  });
});
router.delete(users_url + "/:id", (req, res) => {
  res.json({
    "data": null,
    "meta": {
      "msg": "删除成功",
      "status": 200
    }
  });
});

//返回权限列表数据
const rights_url = baseURL + 'rights';
router.get(rights_url + '/list', (req, res) => {
  res.json({
    "data": [
      {
        "id": 101,
        "authName": "商品管理",
        "level": "0",
        "pid": 0,
        "path": "goods"
      },
      {
        "id": 102,
        "authName": "订单管理",
        "level": "0",
        "pid": 0,
        "path": "orders"
      },
      {
        "id": 103,
        "authName": "权限管理",
        "level": "0",
        "pid": 0,
        "path": "rights"
      },
      {
        "id": 104,
        "authName": "商品列表",
        "level": "1",
        "pid": 101,
        "path": "goods"
      },
      {
        "id": 105,
        "authName": "添加商品",
        "level": "2",
        "pid": 104,
        "path": "goods"
      },
      {
        "id": 107,
        "authName": "订单列表",
        "level": "1",
        "pid": 102,
        "path": "orders"
      },
      {
        "id": 109,
        "authName": "添加订单",
        "level": "2",
        "pid": 107,
        "path": "orders"
      },
      {
        "id": 110,
        "authName": "用户列表",
        "level": "1",
        "pid": 125,
        "path": "users"
      },
      {
        "id": 111,
        "authName": "角色列表",
        "level": "1",
        "pid": 103,
        "path": "roles"
      },
      {
        "id": 112,
        "authName": "权限列表",
        "level": "1",
        "pid": 103,
        "path": "rights"
      },
      {
        "id": 115,
        "authName": "分类参数",
        "level": "1",
        "pid": 101,
        "path": "params"
      },
      {
        "id": 116,
        "authName": "商品修改",
        "level": "2",
        "pid": 104,
        "path": "goods"
      },
      {
        "id": 117,
        "authName": "商品删除",
        "level": "2",
        "pid": 104,
        "path": "goods"
      },
      {
        "id": 121,
        "authName": "商品分类",
        "level": "1",
        "pid": 101,
        "path": "categories"
      },
      {
        "id": 122,
        "authName": "添加分类",
        "level": "2",
        "pid": 121,
        "path": "categories"
      },
      {
        "id": 123,
        "authName": "删除分类",
        "level": "2",
        "pid": 121,
        "path": "categories"
      },
      {
        "id": 125,
        "authName": "用户管理",
        "level": "0",
        "pid": 0,
        "path": "users"
      },
      {
        "id": 129,
        "authName": "添加角色",
        "level": "2",
        "pid": 111,
        "path": "roles"
      },
      {
        "id": 130,
        "authName": "删除角色",
        "level": "2",
        "pid": 111,
        "path": "roles"
      },
      {
        "id": 131,
        "authName": "添加用户",
        "level": "2",
        "pid": 110,
        "path": "users"
      },
      {
        "id": 132,
        "authName": "删除用户",
        "level": "2",
        "pid": 110,
        "path": "users"
      },
      {
        "id": 133,
        "authName": "更新用户",
        "level": "2",
        "pid": 110,
        "path": "users"
      },
      {
        "id": 134,
        "authName": "角色授权",
        "level": "2",
        "pid": 111,
        "path": "roles"
      },
      {
        "id": 135,
        "authName": "取消角色授权",
        "level": "2",
        "pid": 111,
        "path": "roles"
      },
      {
        "id": 136,
        "authName": "获取用户详情",
        "level": "2",
        "pid": 110,
        "path": "users"
      },
      {
        "id": 137,
        "authName": "分配用户角色",
        "level": "2",
        "pid": 110,
        "path": "users"
      },
      {
        "id": 138,
        "authName": "获取角色列表",
        "level": "2",
        "pid": 111,
        "path": "roles"
      },
      {
        "id": 139,
        "authName": "获取角色详情",
        "level": "2",
        "pid": 111,
        "path": "roles"
      },
      {
        "id": 140,
        "authName": "更新角色信息",
        "level": "2",
        "pid": 111,
        "path": "roles"
      },
      {
        "id": 141,
        "authName": "更新角色权限",
        "level": "2",
        "pid": 111,
        "path": "roles"
      },
      {
        "id": 142,
        "authName": "获取参数列表",
        "level": "2",
        "pid": 115,
        "path": "categories"
      },
      {
        "id": 143,
        "authName": "创建商品参数",
        "level": "2",
        "pid": 115,
        "path": "categories"
      },
      {
        "id": 144,
        "authName": "删除商品参数",
        "level": "2",
        "pid": 115,
        "path": "categories"
      },
      {
        "id": 145,
        "authName": "数据统计",
        "level": "0",
        "pid": 0,
        "path": "reports"
      },
      {
        "id": 146,
        "authName": "数据报表",
        "level": "1",
        "pid": 145,
        "path": "reports"
      },
      {
        "id": 147,
        "authName": "查看权限",
        "level": "2",
        "pid": 112,
        "path": "rights"
      },
      {
        "id": 148,
        "authName": "查看数据",
        "level": "2",
        "pid": 146,
        "path": "reports"
      },
      {
        "id": 149,
        "authName": "获取分类详情",
        "level": "2",
        "pid": 121,
        "path": "categories"
      },
      {
        "id": 150,
        "authName": "更新商品图片",
        "level": "2",
        "pid": 104,
        "path": "goods"
      },
      {
        "id": 151,
        "authName": "更新商品属性",
        "level": "2",
        "pid": 104,
        "path": "goods"
      },
      {
        "id": 152,
        "authName": "更新商品状态",
        "level": "2",
        "pid": 104,
        "path": "goods"
      },
      {
        "id": 153,
        "authName": "获取商品详情",
        "level": "2",
        "pid": 104,
        "path": "goods"
      },
      {
        "id": 154,
        "authName": "订单更新",
        "level": "2",
        "pid": 107,
        "path": "orders"
      },
      {
        "id": 155,
        "authName": "获取订单详情",
        "level": "2",
        "pid": 107,
        "path": "orders"
      },
      {
        "id": 156,
        "authName": "分类参数添加",
        "level": "2",
        "pid": 101,
        "path": "categories"
      },
      {
        "id": 157,
        "authName": "分类参数删除",
        "level": "2",
        "pid": 101,
        "path": "categories"
      },
      {
        "id": 158,
        "authName": "分类参数详情",
        "level": "2",
        "pid": 101,
        "path": "categories"
      },
      {
        "id": 159,
        "authName": "设置管理状态",
        "level": "2",
        "pid": 110,
        "path": "users"
      }
    ],
    "meta": {
      "msg": "获取权限列表成功",
      "status": 200
    }
  })
});
//返回角色列表
const roles_url = baseURL + 'roles';
router.get(roles_url, (req, res) => {
  res.json({
    "data": [
      {
        "id": 30,
        "roleName": "主管",
        "roleDesc": "技术负责人",
        "children": [
          {
            "id": 101,
            "authName": "商品管理",
            "path": "goods",
            "children": [
              {
                "id": 104,
                "authName": "商品列表",
                "path": "goods",
                "children": [
                  {
                    "id": 116,
                    "authName": "商品修改",
                    "path": "goods"
                  }
                ]
              },
              {
                "id": 115,
                "authName": "分类参数",
                "path": "params",
                "children": [
                  {
                    "id": 142,
                    "authName": "获取参数列表",
                    "path": "categories"
                  },
                  {
                    "id": 143,
                    "authName": "创建商品参数",
                    "path": "categories"
                  }
                ]
              },
              {
                "id": 121,
                "authName": "商品分类",
                "path": "categories",
                "children": [
                  {
                    "id": 122,
                    "authName": "添加分类",
                    "path": "categories"
                  },
                  {
                    "id": 123,
                    "authName": "删除分类",
                    "path": "categories"
                  },
                  {
                    "id": 149,
                    "authName": "获取分类详情",
                    "path": "categories"
                  }
                ]
              }
            ]
          },
          {
            "id": 102,
            "authName": "订单管理",
            "path": "orders",
            "children": [
              {
                "id": 107,
                "authName": "订单列表",
                "path": "orders",
                "children": [
                  {
                    "id": 109,
                    "authName": "添加订单",
                    "path": "orders"
                  }
                ]
              }
            ]
          },
          {
            "id": 103,
            "authName": "权限管理",
            "path": "rights",
            "children": [
              {
                "id": 111,
                "authName": "角色列表",
                "path": "roles",
                "children": [
                  {
                    "id": 129,
                    "authName": "添加角色",
                    "path": "roles"
                  },
                  {
                    "id": 130,
                    "authName": "删除角色",
                    "path": "roles"
                  },
                  {
                    "id": 134,
                    "authName": "角色授权",
                    "path": "roles"
                  },
                  {
                    "id": 135,
                    "authName": "取消角色授权",
                    "path": "roles"
                  },
                  {
                    "id": 138,
                    "authName": "获取角色列表",
                    "path": "roles"
                  },
                  {
                    "id": 139,
                    "authName": "获取角色详情",
                    "path": "roles"
                  },
                  {
                    "id": 140,
                    "authName": "更新角色信息",
                    "path": "roles"
                  },
                  {
                    "id": 141,
                    "authName": "更新角色权限",
                    "path": "roles"
                  }
                ]
              },
              {
                "id": 112,
                "authName": "权限列表",
                "path": "rights",
                "children": [
                  {
                    "id": 147,
                    "authName": "查看权限",
                    "path": "rights"
                  }
                ]
              }
            ]
          },
          {
            "id": 125,
            "authName": "用户管理",
            "path": "users",
            "children": [
              {
                "id": 110,
                "authName": "用户列表",
                "path": "users",
                "children": [
                  {
                    "id": 131,
                    "authName": "添加用户",
                    "path": "users"
                  },
                  {
                    "id": 132,
                    "authName": "删除用户",
                    "path": "users"
                  },
                  {
                    "id": 133,
                    "authName": "更新用户",
                    "path": "users"
                  },
                  {
                    "id": 136,
                    "authName": "获取用户详情",
                    "path": "users"
                  },
                  {
                    "id": 137,
                    "authName": "分配用户角色",
                    "path": "users"
                  }
                ]
              }
            ]
          },
          {
            "id": 145,
            "authName": "数据统计",
            "path": "reports",
            "children": [
              {
                "id": 146,
                "authName": "数据报表",
                "path": "reports",
                "children": [
                  {
                    "id": 148,
                    "authName": "查看数据",
                    "path": "reports"
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "id": 31,
        "roleName": "测试角色",
        "roleDesc": "测试角色描述",
        "children": [
          {
            "id": 101,
            "authName": "商品管理",
            "path": "goods",
            "children": [
              {
                "id": 104,
                "authName": "商品列表",
                "path": "goods",
                "children": [
                  {
                    "id": 105,
                    "authName": "添加商品",
                    "path": "goods"
                  },
                  {
                    "id": 116,
                    "authName": "商品修改",
                    "path": "goods"
                  },
                  {
                    "id": 117,
                    "authName": "商品删除",
                    "path": "goods"
                  }
                ]
              },
              {
                "id": 115,
                "authName": "分类参数",
                "path": "params",
                "children": [
                  {
                    "id": 142,
                    "authName": "获取参数列表",
                    "path": "categories"
                  },
                  {
                    "id": 143,
                    "authName": "创建商品参数",
                    "path": "categories"
                  },
                  {
                    "id": 144,
                    "authName": "删除商品参数",
                    "path": "categories"
                  }
                ]
              },
              {
                "id": 121,
                "authName": "商品分类",
                "path": "categories",
                "children": [
                  {
                    "id": 122,
                    "authName": "添加分类",
                    "path": "categories"
                  },
                  {
                    "id": 123,
                    "authName": "删除分类",
                    "path": "categories"
                  },
                  {
                    "id": 149,
                    "authName": "获取分类详情",
                    "path": "categories"
                  }
                ]
              }
            ]
          },
          {
            "id": 103,
            "authName": "权限管理",
            "path": "rights",
            "children": [
              {
                "id": 111,
                "authName": "角色列表",
                "path": "roles",
                "children": [
                  {
                    "id": 129,
                    "authName": "添加角色",
                    "path": "roles"
                  },
                  {
                    "id": 134,
                    "authName": "角色授权",
                    "path": "roles"
                  },
                  {
                    "id": 138,
                    "authName": "获取角色列表",
                    "path": "roles"
                  }
                ]
              },
              {
                "id": 112,
                "authName": "权限列表",
                "path": "rights",
                "children": [
                  {
                    "id": 147,
                    "authName": "查看权限",
                    "path": "rights"
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "id": 34,
        "roleName": "测试角色2",
        "roleDesc": "测试描述12",
        "children": [
          {
            "id": 101,
            "authName": "商品管理",
            "path": "goods",
            "children": [
              {
                "id": 104,
                "authName": "商品列表",
                "path": "goods",
                "children": [
                  {
                    "id": 116,
                    "authName": "商品修改",
                    "path": "goods"
                  },
                  {
                    "id": 117,
                    "authName": "商品删除",
                    "path": "goods"
                  },
                  {
                    "id": 150,
                    "authName": "更新商品图片",
                    "path": "goods"
                  },
                  {
                    "id": 151,
                    "authName": "更新商品属性",
                    "path": "goods"
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "id": 39,
        "roleName": "大发送到",
        "roleDesc": "阿斯蒂芬",
        "children": [
          {
            "id": 101,
            "authName": "商品管理",
            "path": "goods",
            "children": [
              {
                "id": 104,
                "authName": "商品列表",
                "path": "goods",
                "children": [
                  {
                    "id": 105,
                    "authName": "添加商品",
                    "path": "goods"
                  },
                  {
                    "id": 116,
                    "authName": "商品修改",
                    "path": "goods"
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "id": 40,
        "roleName": "test",
        "roleDesc": "test",
        "children": [
          {
            "id": 102,
            "authName": "订单管理",
            "path": "orders",
            "children": [
              {
                "id": 107,
                "authName": "订单列表",
                "path": "orders",
                "children": [
                  {
                    "id": 109,
                    "authName": "添加订单",
                    "path": "orders"
                  },
                  {
                    "id": 154,
                    "authName": "订单更新",
                    "path": "orders"
                  },
                  {
                    "id": 155,
                    "authName": "获取订单详情",
                    "path": "orders"
                  }
                ]
              }
            ]
          },
          {
            "id": 145,
            "authName": "数据统计",
            "path": "reports",
            "children": [
              {
                "id": 146,
                "authName": "数据报表",
                "path": "reports",
                "children": [
                  {
                    "id": 148,
                    "authName": "查看数据",
                    "path": "reports"
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "id": 41,
        "roleName": "dsdf",
        "roleDesc": "sf ",
        "children": []
      }
    ],
    "meta": {
      "msg": "获取成功",
      "status": 200
    }
  });
});
router.get(roles_url + '/:id', (req, res) => {
  res.json({
    "data": {
      "roleId": 30,
      "roleName": "主管",
      "roleDesc": "技术负责人",
      "rolePermissionDesc": "Goods-index,Goods-tianjia,Category-index,Order-showlist,Brand-index"
    },
    "meta": {
      "msg": "获取成功",
      "status": 200
    }
  });
});
router.put(roles_url + '/:id', (req, res) => {
  res.json({
    "data": {
      "roleId": req.body.roleId,
      "roleName": req.body.roleName,
      "roleDesc": req.body.roleDesc
    },
    "meta": {
      "msg": "获取成功",
      "status": 200
    }
  })
});
router.delete(roles_url + '/:id', (req, res) => {
  res.json({
    "data": null,
    "meta": {
      "msg": "删除成功",
      "status": 200
    }
  })
});
router.post(roles_url, (req, res) => {
  res.json({
    "data": {
      "roleId": 40,
      "roleName": "admin2",
      "roleDesc": "admin2Desc"
    },
    "meta": {
      "msg": "创建成功",
      "status": 201
    }
  });
});
//获取商品列表
const goods_url = baseURL + 'goods';
router.get(goods_url, (req, res) => {
  res.json({
    "data": {
      "total": 928,
      "pagenum": "1",
      "goods": [
        {
          "goods_id": 930,
          "cat_id": null,
          "goods_name": "ww",
          "goods_price": 1,
          "goods_number": 3,
          "goods_weight": 2,
          "goods_state": null,
          "add_time": 1617612207,
          "upd_time": 1617612207,
          "hot_mumber": 0,
          "is_promote": false,
          "cat_one_id": null,
          "cat_two_id": null,
          "cat_three_id": null
        },
        {
          "goods_id": 929,
          "cat_id": null,
          "goods_name": "aa",
          "goods_price": 1,
          "goods_number": 1,
          "goods_weight": 1,
          "goods_state": null,
          "add_time": 1617612137,
          "upd_time": 1617612137,
          "hot_mumber": 0,
          "is_promote": false,
          "cat_one_id": null,
          "cat_two_id": null,
          "cat_three_id": null
        },
        {
          "goods_id": 928,
          "cat_id": null,
          "goods_name": "a",
          "goods_price": 1,
          "goods_number": 1,
          "goods_weight": 1,
          "goods_state": null,
          "add_time": 1617612044,
          "upd_time": 1617612044,
          "hot_mumber": 0,
          "is_promote": false,
          "cat_one_id": null,
          "cat_two_id": null,
          "cat_three_id": null
        },
        {
          "goods_id": 925,
          "cat_id": null,
          "goods_name": "卡奇莱德汽车车载空气净化器负离子除甲醛PM2.5除烟异味车用氧吧双涡轮出风（红色）",
          "goods_price": 168,
          "goods_number": 100,
          "goods_weight": 100,
          "goods_state": 0,
          "add_time": 1514259452,
          "upd_time": 1514259452,
          "hot_mumber": 0,
          "is_promote": false,
          "cat_one_id": null,
          "cat_two_id": null,
          "cat_three_id": null
        },
        {
          "goods_id": 924,
          "cat_id": null,
          "goods_name": "沿途（yantu）车载充电器车充一拖二usb转接口手机智能头多功能汽车点烟器",
          "goods_price": 0,
          "goods_number": 100,
          "goods_weight": 100,
          "goods_state": 0,
          "add_time": 1514259448,
          "upd_time": 1514259448,
          "hot_mumber": 0,
          "is_promote": false,
          "cat_one_id": null,
          "cat_two_id": null,
          "cat_three_id": null
        }
      ]
    },
    "meta": {
      "msg": "获取成功",
      "status": 200
    }
  });
});
router.get(goods_url+'/:id',(req, res) => {
  res.json({
    "data": {
      "goods_id": 145,
      "goods_cat":'1,3,6',
      "goods_name": "test_goods_name2",
      "goods_price": 20,
      "goods_number": 30,
      "goods_weight": 40,
      "goods_introduce": "abc",
      "goods_big_logo": "",
      "goods_small_logo": "",
      "goods_state": 1,
      "add_time": 1512962370,
      "upd_time": 1512962370,
      "hot_mumber": 0,
      "is_promote": false,
      "pics": [
        {
          "pics_id": 397,
          "goods_id": 145,
          "pics_big": "uploads/goodspics/big_30f08d52c551ecb447277eae232304b8",
          "pics_mid": "uploads/goodspics/mid_30f08d52c551ecb447277eae232304b8",
          "pics_sma": "uploads/goodspics/sma_30f08d52c551ecb447277eae232304b8"
        }
      ],
      "attrs": [
        {
          "goods_id": 145,
          "attr_id": 15,
          "attr_value": "ddd",
          "add_price": null,
          "attr_name": "fffffff",
          "attr_sel": "many",
          "attr_write": "list",
          "attr_vals": ""
        },
        {
          "goods_id": 145,
          "attr_id": 15,
          "attr_value": "eee",
          "add_price": null,
          "attr_name": "fffffff",
          "attr_sel": "many",
          "attr_write": "list",
          "attr_vals": ""
        }
      ]
    },
    "meta": {
      "msg": "创建商品成功",
      "status": 201
    }
  });
});
router.delete(goods_url + '/:id', (req, res) => {
  res.json({
    "data": null,
    "meta": {
      "msg": "删除成功",
      "status": 200
    }
  });
});
router.post(goods_url,(req, res) => {
  res.json({
    "data": {
      "goods_id": 145,
      "goods_name": "test_goods_name2",
      "goods_price": 20,
      "cat_id": 1,
      "goods_number": 30,
      "goods_weight": 40,
      "goods_introduce": "abc",
      "goods_big_logo": "",
      "goods_small_logo": "",
      "goods_state": 1,
      "add_time": 1512962370,
      "upd_time": 1512962370,
      "hot_mumber": 0,
      "is_promote": false,
      "pics": [
        {
          "pics_id": 397,
          "goods_id": 145,
          "pics_big": "uploads/goodspics/big_30f08d52c551ecb447277eae232304b8",
          "pics_mid": "uploads/goodspics/mid_30f08d52c551ecb447277eae232304b8",
          "pics_sma": "uploads/goodspics/sma_30f08d52c551ecb447277eae232304b8"
        }
      ],
      "attrs": [
        {
          "goods_id": 145,
          "attr_id": 15,
          "attr_value": "ddd",
          "add_price": null,
          "attr_name": "fffffff",
          "attr_sel": "many",
          "attr_write": "list",
          "attr_vals": ""
        },
        {
          "goods_id": 145,
          "attr_id": 15,
          "attr_value": "eee",
          "add_price": null,
          "attr_name": "fffffff",
          "attr_sel": "many",
          "attr_write": "list",
          "attr_vals": ""
        }
      ]
    },
    "meta": {
      "msg": "创建商品成功",
      "status": 201
    }
  });
});
//获取报表数据
const report_url = baseURL + 'reports/type/1';
router.get(report_url, (req, res) => {
  res.json({
    "data": {
      "legend": {
        "data": [
          "华东",
          "华南",
          "华北",
          "西部",
          "其他"
        ]
      },
      "yAxis": [
        {
          "type": "value"
        }
      ],
      "xAxis": [
        {
          "data": [
            "2017-12-27",
            "2017-12-28",
            "2017-12-29",
            "2017-12-30",
            "2017-12-31",
            "2018-1-1"
          ]
        }
      ],
      "series": [
        {
          "name": "华东",
          "type": "line",
          "stack": "总量",
          "areaStyle": {
            "normal": {}
          },
          "data": [
            2999,
            3111,
            4100,
            3565,
            3528,
            6000
          ]
        },
        {
          "name": "华南",
          "type": "line",
          "stack": "总量",
          "areaStyle": {
            "normal": {}
          },
          "data": [
            5090,
            2500,
            3400,
            6000,
            6400,
            7800
          ]
        },
        {
          "name": "华北",
          "type": "line",
          "stack": "总量",
          "areaStyle": {
            "normal": {}
          },
          "data": [
            6888,
            4000,
            8010,
            12321,
            13928,
            12984
          ]
        },
        {
          "name": "西部",
          "type": "line",
          "stack": "总量",
          "areaStyle": {
            "normal": {}
          },
          "data": [
            9991,
            4130,
            7777,
            12903,
            13098,
            14028
          ]
        },
        {
          "name": "其他",
          "type": "line",
          "stack": "总量",
          "areaStyle": {
            "normal": {}
          },
          "data": [
            15212,
            5800,
            10241,
            14821,
            15982,
            14091
          ]
        }
      ]
    },
    "meta": {
      "msg": "获取报表成功",
      "status": 200
    }
  });
});
//获取订单列表数据
const orders_url = baseURL + 'orders';
router.get(orders_url, (req, res) => {
  res.json({
    "data": {
      "total": 27,
      "pagenum": "1",
      "goods": [
        {
          "order_id": 68,
          "user_id": 1,
          "order_number": "itcast-g7kmck725jaujgdts",
          "order_price": 40,
          "order_pay": "0",
          "is_send": "否",
          "trade_no": "",
          "order_fapiao_title": "个人",
          "order_fapiao_company": "",
          "order_fapiao_content": "",
          "consignee_addr": "",
          "pay_status": "0",
          "create_time": 1512535620,
          "update_time": 1512535620
        },
        {
          "order_id": 67,
          "user_id": 1,
          "order_number": "itcast-g7kmck71vjaujfgoi",
          "order_price": 20,
          "order_pay": "0",
          "is_send": "否",
          "trade_no": "",
          "order_fapiao_title": "个人",
          "order_fapiao_company": "",
          "order_fapiao_content": "",
          "consignee_addr": "",
          "pay_status": "0",
          "create_time": 1512533560,
          "update_time": 1512533560
        },
        {
          "order_id": 66,
          "user_id": 1,
          "order_number": "itcast-g7kmck71jjaujer6a",
          "order_price": 20,
          "order_pay": "0",
          "is_send": "否",
          "trade_no": "",
          "order_fapiao_title": "个人",
          "order_fapiao_company": "",
          "order_fapiao_content": "",
          "consignee_addr": "",
          "pay_status": "0",
          "create_time": 1512533527,
          "update_time": 1512533527
        },
        {
          "order_id": 65,
          "user_id": 1,
          "order_number": "itcast-g7kmck6rwjauin92y",
          "order_price": 20,
          "order_pay": "0",
          "is_send": "否",
          "trade_no": "",
          "order_fapiao_title": "个人",
          "order_fapiao_company": "",
          "order_fapiao_content": "",
          "consignee_addr": "",
          "pay_status": "0",
          "create_time": 1512532244,
          "update_time": 1512532244
        },
        {
          "order_id": 64,
          "user_id": 1,
          "order_number": "itcast-g7kmck6rmjauimx8v",
          "order_price": 20,
          "order_pay": "0",
          "is_send": "否",
          "trade_no": "",
          "order_fapiao_title": "个人",
          "order_fapiao_company": "",
          "order_fapiao_content": "",
          "consignee_addr": "",
          "pay_status": "0",
          "create_time": 1512532229,
          "update_time": 1512532229
        }
      ]
    },
    "meta": {
      "msg": "获取成功",
      "status": 200
    }
  });
});
//获取订单详情
router.get(orders_url + '/:id', (req, res) => {
  res.json({
    "data": {
      "order_id": 67,
      "user_id": 1,
      "order_number": "itcast-g7kmck71vjaujfgoi",
      "order_price": 20,
      "order_pay": "0",
      "is_send": "否",
      "trade_no": "",
      "order_fapiao_title": "个人",
      "order_fapiao_company": "",
      "order_fapiao_content": "",
      "consignee_addr": "",
      "pay_status": "0",
      "create_time": 1512533560,
      "update_time": 1512533560,
      "goods": [
        {
          "id": 82,
          "order_id": 67,
          "goods_id": 96,
          "goods_price": 333,
          "goods_number": 2,
          "goods_total_price": 999
        },
        {
          "id": 83,
          "order_id": 67,
          "goods_id": 95,
          "goods_price": 666,
          "goods_number": 5,
          "goods_total_price": 999
        }
      ]
    },
    "meta": {
      "msg": "获取成功",
      "status": 200
    }
  });
});
router.put(orders_url + '/:id', (req, res) => {
  res.json({
    "data": {
      "order_id": 67,
      "user_id": 1,
      "order_number": "itcast-g7kmck71vjaujfgoi",
      "order_price": 20,
      "order_pay": "0",
      "is_send": "否",
      "trade_no": "",
      "order_fapiao_title": "个人",
      "order_fapiao_company": "",
      "order_fapiao_content": "",
      "consignee_addr": "",
      "pay_status": "0",
      "create_time": 1512533560,
      "update_time": 1512533560,
      "goods": [
        {
          "id": 82,
          "order_id": 67,
          "goods_id": 96,
          "goods_price": 333,
          "goods_number": 2,
          "goods_total_price": 999
        },
        {
          "id": 83,
          "order_id": 67,
          "goods_id": 95,
          "goods_price": 666,
          "goods_number": 5,
          "goods_total_price": 999
        }
      ]
    },
    "meta": {
      "msg": "获取成功",
      "status": 200
    }
  });
});
//获取物流信息
const express_url = baseURL + 'express/:id';
router.get(express_url, (req, res) => {
  res.json({
    "data": [
      {
        "timestamp": "2018-05-10 09:39:00",
        "content": "已签收,感谢使用顺丰,期待再次为您服务",
        "location": ""
      },
      {
        "timestamp": "2018-05-10 08:23:00",
        "content": "[北京市]北京海淀育新小区营业点派件员 顺丰速运 95338正在为您派件",
        "location": ""
      },
      {
        "timestamp": "2018-05-10 07:32:00",
        "content": "快件到达 [北京海淀育新小区营业点]",
        "location": ""
      },
      {
        "timestamp": "2018-05-10 02:03:00",
        "content": "快件在[北京顺义集散中心]已装车,准备发往 [北京海淀育新小区营业点]",
        "location": ""
      },
      {
        "timestamp": "2018-05-09 23:05:00",
        "content": "快件到达 [北京顺义集散中心]",
        "location": ""
      },
      {
        "timestamp": "2018-05-09 21:21:00",
        "content": "快件在[北京宝胜营业点]已装车,准备发往 [北京顺义集散中心]",
        "location": ""
      },
      {
        "timestamp": "2018-05-09 13:07:00",
        "content": "顺丰速运 已收取快件",
        "location": ""
      },
      {
        "timestamp": "2018-05-09 12:25:03",
        "content": "卖家发货",
        "location": ""
      },
      {
        "timestamp": "2018-05-09 12:22:24",
        "content": "您的订单将由HLA（北京海淀区清河中街店）门店安排发货。",
        "location": ""
      },
      {
        "timestamp": "2018-05-08 21:36:04",
        "content": "商品已经下单",
        "location": ""
      }
    ],
    "meta": {"status": 200, "message": "获取物流信息成功！"}
  });
});
//
const updateRights_url = baseURL + 'roles/:roleId/rights/:rightId';
router.delete(updateRights_url, (req, res) => {
  res.json({
    "data": [
      {
        "id": 101,
        "authName": "商品管理",
        "path": null,
        "children": [
          {
            "id": 104,
            "authName": "商品列表",
            "path": null,
            "children": [
              {
                "id": 105,
                "authName": "添加商品",
                "path": null
              },
              {
                "id": 116,
                "authName": "修改",
                "path": null
              }
            ]
          }
        ]
      }
    ],
    "meta": {
      "msg": "取消权限成功",
      "status": 200
    }
  });
});
const rightsTree_url = baseURL + 'rights/tree';
router.get(rightsTree_url, (req, res) => {
  res.json({
    "data": [
      {
        "id": 101,
        "authName": "商品管理",
        "path": "goods",
        "pid": 0,
        "children": [
          {
            "id": 104,
            "authName": "商品列表",
            "path": "goods",
            "pid": 101,
            "children": [
              {
                "id": 105,
                "authName": "添加商品",
                "path": "goods",
                "pid": "104,101"
              },
              {
                "id": 116,
                "authName": "商品修改",
                "path": "goods",
                "pid": "104,101"
              },
              {
                "id": 117,
                "authName": "商品删除",
                "path": "goods",
                "pid": "104,101"
              },
              {
                "id": 150,
                "authName": "更新商品图片",
                "path": "goods",
                "pid": "104,101"
              },
              {
                "id": 151,
                "authName": "更新商品属性",
                "path": "goods",
                "pid": "104,101"
              },
              {
                "id": 152,
                "authName": "更新商品状态",
                "path": "goods",
                "pid": "104,101"
              },
              {
                "id": 153,
                "authName": "获取商品详情",
                "path": "goods",
                "pid": "104,101"
              }
            ]
          },
          {
            "id": 115,
            "authName": "分类参数",
            "path": "params",
            "pid": 101,
            "children": [
              {
                "id": 142,
                "authName": "获取参数列表",
                "path": "categories",
                "pid": "115,101"
              },
              {
                "id": 143,
                "authName": "创建商品参数",
                "path": "categories",
                "pid": "115,101"
              },
              {
                "id": 144,
                "authName": "删除商品参数",
                "path": "categories",
                "pid": "115,101"
              }
            ]
          },
          {
            "id": 121,
            "authName": "商品分类",
            "path": "categories",
            "pid": 101,
            "children": [
              {
                "id": 122,
                "authName": "添加分类",
                "path": "categories",
                "pid": "121,101"
              },
              {
                "id": 123,
                "authName": "删除分类",
                "path": "categories",
                "pid": "121,101"
              },
              {
                "id": 149,
                "authName": "获取分类详情",
                "path": "categories",
                "pid": "121,101"
              }
            ]
          }
        ]
      },
      {
        "id": 102,
        "authName": "订单管理",
        "path": "orders",
        "pid": 0,
        "children": [
          {
            "id": 107,
            "authName": "订单列表",
            "path": "orders",
            "pid": 102,
            "children": [
              {
                "id": 109,
                "authName": "添加订单",
                "path": "orders",
                "pid": "107,102"
              },
              {
                "id": 154,
                "authName": "订单更新",
                "path": "orders",
                "pid": "107,102"
              },
              {
                "id": 155,
                "authName": "获取订单详情",
                "path": "orders",
                "pid": "107,102"
              }
            ]
          }
        ]
      },
      {
        "id": 103,
        "authName": "权限管理",
        "path": "rights",
        "pid": 0,
        "children": [
          {
            "id": 111,
            "authName": "角色列表",
            "path": "roles",
            "pid": 103,
            "children": [
              {
                "id": 129,
                "authName": "添加角色",
                "path": "roles",
                "pid": "111,103"
              },
              {
                "id": 130,
                "authName": "删除角色",
                "path": "roles",
                "pid": "111,103"
              },
              {
                "id": 134,
                "authName": "角色授权",
                "path": "roles",
                "pid": "111,103"
              },
              {
                "id": 135,
                "authName": "取消角色授权",
                "path": "roles",
                "pid": "111,103"
              },
              {
                "id": 138,
                "authName": "获取角色列表",
                "path": "roles",
                "pid": "111,103"
              },
              {
                "id": 139,
                "authName": "获取角色详情",
                "path": "roles",
                "pid": "111,103"
              },
              {
                "id": 140,
                "authName": "更新角色信息",
                "path": "roles",
                "pid": "111,103"
              },
              {
                "id": 141,
                "authName": "更新角色权限",
                "path": "roles",
                "pid": "111,103"
              }
            ]
          },
          {
            "id": 112,
            "authName": "权限列表",
            "path": "rights",
            "pid": 103,
            "children": [
              {
                "id": 147,
                "authName": "查看权限",
                "path": "rights",
                "pid": "112,103"
              }
            ]
          }
        ]
      },
      {
        "id": 125,
        "authName": "用户管理",
        "path": "users",
        "pid": 0,
        "children": [
          {
            "id": 110,
            "authName": "用户列表",
            "path": "users",
            "pid": 125,
            "children": [
              {
                "id": 131,
                "authName": "添加用户",
                "path": "users",
                "pid": "110,125"
              },
              {
                "id": 132,
                "authName": "删除用户",
                "path": "users",
                "pid": "110,125"
              },
              {
                "id": 133,
                "authName": "更新用户",
                "path": "users",
                "pid": "110,125"
              },
              {
                "id": 136,
                "authName": "获取用户详情",
                "path": "users",
                "pid": "110,125"
              },
              {
                "id": 137,
                "authName": "分配用户角色",
                "path": "users",
                "pid": "110,125"
              },
              {
                "id": 159,
                "authName": "设置管理状态",
                "path": "users",
                "pid": "110,125"
              }
            ]
          }
        ]
      },
      {
        "id": 145,
        "authName": "数据统计",
        "path": "reports",
        "pid": 0,
        "children": [
          {
            "id": 146,
            "authName": "数据报表",
            "path": "reports",
            "pid": 145,
            "children": [
              {
                "id": 148,
                "authName": "查看数据",
                "path": "reports",
                "pid": "146,145"
              }
            ]
          }
        ]
      }
    ],
    "meta": {
      "msg": "获取权限列表成功",
      "status": 200
    }
  });
});
router.post(baseURL + 'roles/:roleId/rights', (req, res) => {
  res.json({
    "data": null,
    "meta": {
      "msg": "更新成功",
      "status": 200
    }
  });
});

const cate_url = baseURL + 'categories';
router.get(cate_url, (req, res) => {
  console.log(req.query);
  if (req.query.type === '2') {
    res.json({
      "data": [
        {
          "cat_id": 1,
          "cat_name": "大家电",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 3,
              "cat_name": "电视",
              "cat_pid": 1,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 4,
              "cat_name": "空调",
              "cat_pid": 1,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 26,
              "cat_name": "洗衣机",
              "cat_pid": 1,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 45,
              "cat_name": "冰箱",
              "cat_pid": 1,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 52,
          "cat_name": "热门推荐",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 64,
              "cat_name": "圣诞狂欢",
              "cat_pid": 52,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 70,
          "cat_name": "海外购",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 75,
              "cat_name": "国际名牌",
              "cat_pid": 70,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 93,
              "cat_name": "母婴儿童",
              "cat_pid": 70,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 96,
              "cat_name": "美妆",
              "cat_pid": 70,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 113,
              "cat_name": "个护",
              "cat_pid": 70,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 115,
              "cat_name": "营养保健",
              "cat_pid": 70,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 128,
              "cat_name": "食品",
              "cat_pid": 70,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 133,
              "cat_name": "数码家电",
              "cat_pid": 70,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 151,
              "cat_name": "服饰箱包",
              "cat_pid": 70,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 157,
              "cat_name": "家居日用",
              "cat_pid": 70,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 172,
          "cat_name": "苏宁房产",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 173,
              "cat_name": "苏宁房产",
              "cat_pid": 172,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 174,
          "cat_name": "手机相机",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 178,
              "cat_name": "大牌推荐",
              "cat_pid": 174,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 185,
              "cat_name": "搞机达人",
              "cat_pid": 174,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 199,
              "cat_name": "手机配件",
              "cat_pid": 174,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 207,
              "cat_name": "手机服务",
              "cat_pid": 174,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 211,
              "cat_name": "运营商",
              "cat_pid": 174,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 223,
              "cat_name": "摄影摄像",
              "cat_pid": 174,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 246,
              "cat_name": "相机配件",
              "cat_pid": 174,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 270,
          "cat_name": "电脑办公",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 273,
              "cat_name": "电脑整机",
              "cat_pid": 270,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 283,
              "cat_name": "电脑外设",
              "cat_pid": 270,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 290,
              "cat_name": "DIY硬件",
              "cat_pid": 270,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 298,
              "cat_name": "网络设备",
              "cat_pid": 270,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 308,
              "cat_name": "办公设备",
              "cat_pid": 270,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 315,
              "cat_name": "文具用品",
              "cat_pid": 270,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 320,
          "cat_name": "厨卫电器",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 325,
              "cat_name": "卫浴电器",
              "cat_pid": 320,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 332,
              "cat_name": "厨房大电",
              "cat_pid": 320,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 342,
              "cat_name": "净水设备",
              "cat_pid": 320,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 351,
          "cat_name": "食品酒水",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 356,
              "cat_name": "中外名酒",
              "cat_pid": 351,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 360,
              "cat_name": "牛奶冲调",
              "cat_pid": 351,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 369,
              "cat_name": "生鲜蔬果",
              "cat_pid": 351,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 377,
              "cat_name": "休闲食品",
              "cat_pid": 351,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 383,
              "cat_name": "粮油干货",
              "cat_pid": 351,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 394,
              "cat_name": "进口食品",
              "cat_pid": 351,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 401,
              "cat_name": "方便速食",
              "cat_pid": 351,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 403,
              "cat_name": "厨房调料",
              "cat_pid": 351,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 406,
          "cat_name": "居家生活",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 411,
              "cat_name": "生活用纸",
              "cat_pid": 406,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 419,
              "cat_name": "家庭清洁",
              "cat_pid": 406,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 427,
              "cat_name": "生活日用",
              "cat_pid": 406,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 439,
              "cat_name": "家纺布艺",
              "cat_pid": 406,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 447,
              "cat_name": "宠物生活",
              "cat_pid": 406,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 453,
          "cat_name": "厨房电器",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 458,
              "cat_name": "中式厨房",
              "cat_pid": 453,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 473,
              "cat_name": "西式厨房",
              "cat_pid": 453,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 483,
          "cat_name": "生活电器",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 487,
              "cat_name": "环境电器",
              "cat_pid": 483,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 505,
              "cat_name": "家居电器",
              "cat_pid": 483,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 513,
          "cat_name": "个护健康",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 523,
              "cat_name": "理容造型",
              "cat_pid": 513,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 526,
              "cat_name": "口腔护理",
              "cat_pid": 513,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 528,
              "cat_name": "健康电器",
              "cat_pid": 513,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 550,
          "cat_name": "烹饪厨具",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 553,
              "cat_name": "锅具",
              "cat_pid": 550,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 572,
              "cat_name": "刀剪菜板",
              "cat_pid": 550,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 577,
              "cat_name": "水具酒具",
              "cat_pid": 550,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 580,
          "cat_name": "家装建材",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 589,
              "cat_name": "灯具灯饰",
              "cat_pid": 580,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 599,
              "cat_name": "厨房卫浴",
              "cat_pid": 580,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 616,
              "cat_name": "五金电工",
              "cat_pid": 580,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 638,
              "cat_name": "墙地面",
              "cat_pid": 580,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 645,
              "cat_name": "卧室家具",
              "cat_pid": 580,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 659,
              "cat_name": "客厅家具",
              "cat_pid": 580,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 669,
              "cat_name": "书房办公",
              "cat_pid": 580,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 678,
              "cat_name": "餐厅门厅",
              "cat_pid": 580,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 686,
              "cat_name": "定制装修",
              "cat_pid": 580,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 696,
              "cat_name": "品牌墙",
              "cat_pid": 580,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 710,
          "cat_name": "奶粉尿裤",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 719,
              "cat_name": "孕婴奶粉",
              "cat_pid": 710,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 721,
              "cat_name": "尿裤湿巾",
              "cat_pid": 710,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 730,
              "cat_name": "营养辅食",
              "cat_pid": 710,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 740,
              "cat_name": "洗护用品",
              "cat_pid": 710,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 760,
              "cat_name": "喂养用品",
              "cat_pid": 710,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 777,
              "cat_name": "儿童玩具",
              "cat_pid": 710,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 787,
              "cat_name": "童车童床",
              "cat_pid": 710,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 801,
              "cat_name": "妈妈专区",
              "cat_pid": 710,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 818,
              "cat_name": "品牌墙",
              "cat_pid": 710,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 847,
          "cat_name": "男装",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 849,
              "cat_name": "精选",
              "cat_pid": 847,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 863,
              "cat_name": "外套",
              "cat_pid": 847,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 871,
              "cat_name": "男士内搭",
              "cat_pid": 847,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 872,
              "cat_name": "男士裤装",
              "cat_pid": 847,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 873,
              "cat_name": "品牌墙",
              "cat_pid": 847,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 892,
          "cat_name": "男鞋",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 897,
              "cat_name": "时尚男鞋",
              "cat_pid": 892,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 901,
              "cat_name": "品牌墙",
              "cat_pid": 892,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 904,
          "cat_name": "女装",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 906,
              "cat_name": "精选",
              "cat_pid": 904,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 912,
              "cat_name": "潮流女装",
              "cat_pid": 904,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 927,
              "cat_name": "品牌墙",
              "cat_pid": 904,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 938,
          "cat_name": "女鞋",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 950,
              "cat_name": "时尚女鞋",
              "cat_pid": 938,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 952,
              "cat_name": "品牌墙",
              "cat_pid": 938,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 954,
          "cat_name": "汽车生活",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 956,
              "cat_name": "汽车整车",
              "cat_pid": 954,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 958,
              "cat_name": "养护配件",
              "cat_pid": 954,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 975,
              "cat_name": "清洁美容",
              "cat_pid": 954,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 977,
              "cat_name": "汽车电子",
              "cat_pid": 954,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 984,
              "cat_name": "汽车装饰",
              "cat_pid": 954,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 1000,
          "cat_name": "运动户外",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 1001,
              "cat_name": "热门推荐",
              "cat_pid": 1000,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1004,
              "cat_name": "运动服饰",
              "cat_pid": 1000,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1013,
              "cat_name": "健身器材",
              "cat_pid": 1000,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1027,
              "cat_name": "骑行装备",
              "cat_pid": 1000,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1031,
              "cat_name": "体育休闲",
              "cat_pid": 1000,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1047,
              "cat_name": "户外鞋服",
              "cat_pid": 1000,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1056,
              "cat_name": "垂钓用品",
              "cat_pid": 1000,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1061,
              "cat_name": "运动鞋",
              "cat_pid": 1000,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1073,
              "cat_name": "户外装备",
              "cat_pid": 1000,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1081,
              "cat_name": "运动包/配件",
              "cat_pid": 1000,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1084,
              "cat_name": "品牌墙",
              "cat_pid": 1000,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 1100,
          "cat_name": "美妆洗护",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 1103,
              "cat_name": "面部护理",
              "cat_pid": 1100,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1109,
              "cat_name": "美发护发",
              "cat_pid": 1100,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1111,
              "cat_name": "身体护理",
              "cat_pid": 1100,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1132,
              "cat_name": "口腔护理",
              "cat_pid": 1100,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1133,
              "cat_name": "男士护理",
              "cat_pid": 1100,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1135,
              "cat_name": "女性护理",
              "cat_pid": 1100,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1138,
              "cat_name": "香水彩妆",
              "cat_pid": 1100,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1151,
              "cat_name": "品牌墙",
              "cat_pid": 1100,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 1157,
          "cat_name": "内衣配饰",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 1162,
              "cat_name": "文胸",
              "cat_pid": 1157,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1169,
              "cat_name": "睡衣",
              "cat_pid": 1157,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1174,
              "cat_name": "内裤",
              "cat_pid": 1157,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1187,
              "cat_name": "袜子",
              "cat_pid": 1157,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1192,
              "cat_name": "保暖内衣",
              "cat_pid": 1157,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1202,
              "cat_name": "配饰",
              "cat_pid": 1157,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1208,
              "cat_name": "品牌墙",
              "cat_pid": 1157,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 1218,
          "cat_name": "童装玩具",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 1225,
              "cat_name": "婴幼玩具",
              "cat_pid": 1218,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1228,
              "cat_name": "户外玩具",
              "cat_pid": 1218,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1231,
              "cat_name": "DIY玩具",
              "cat_pid": 1218,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1246,
              "cat_name": "遥控模型玩具",
              "cat_pid": 1218,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1250,
              "cat_name": "童装",
              "cat_pid": 1218,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1259,
              "cat_name": "童鞋",
              "cat_pid": 1218,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1273,
              "cat_name": "宝宝寝居",
              "cat_pid": 1218,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1282,
              "cat_name": "品牌墙",
              "cat_pid": 1218,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 1295,
          "cat_name": "珠宝首饰",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 1301,
              "cat_name": "黄金珠宝",
              "cat_pid": 1295,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1311,
              "cat_name": "首饰配饰",
              "cat_pid": 1295,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1315,
              "cat_name": "邮币",
              "cat_pid": 1295,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1327,
              "cat_name": "品牌墙",
              "cat_pid": 1295,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 1335,
          "cat_name": "智能设备",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 1343,
              "cat_name": "智能酷玩",
              "cat_pid": 1335,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1350,
              "cat_name": "潮流数码",
              "cat_pid": 1335,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1352,
              "cat_name": "智能家居",
              "cat_pid": 1335,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1357,
              "cat_name": "电子教育",
              "cat_pid": 1335,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1367,
              "cat_name": "品牌墙",
              "cat_pid": 1335,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 1369,
          "cat_name": "钟表眼镜",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 1375,
              "cat_name": "精品钟表",
              "cat_pid": 1369,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1383,
              "cat_name": "眼镜",
              "cat_pid": 1369,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1397,
              "cat_name": "品牌墙",
              "cat_pid": 1369,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 1402,
          "cat_name": "皮具箱包",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 1410,
              "cat_name": "功能箱包",
              "cat_pid": 1402,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1419,
              "cat_name": "时尚女包",
              "cat_pid": 1402,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1420,
              "cat_name": "男包皮具",
              "cat_pid": 1402,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1428,
              "cat_name": "品牌墙",
              "cat_pid": 1402,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 1441,
          "cat_name": "邮币乐器",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 1444,
              "cat_name": "礼品",
              "cat_pid": 1441,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1455,
              "cat_name": "邮币",
              "cat_pid": 1441,
              "cat_level": 1,
              "cat_deleted": false
            },
            {
              "cat_id": 1464,
              "cat_name": "乐器",
              "cat_pid": 1441,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 1480,
          "cat_name": "其他",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false,
          "children": [
            {
              "cat_id": 1482,
              "cat_name": "热门关键词",
              "cat_pid": 1480,
              "cat_level": 1,
              "cat_deleted": false
            }
          ]
        },
        {
          "cat_id": 1484,
          "cat_name": "test1",
          "cat_pid": 0,
          "cat_level": 0,
          "cat_deleted": false
        }
      ],
      "meta": {
        "msg": "获取成功",
        "status": 200
      }
    });
  }
  else {
    res.json({
      "data": {
        "total": 31,
        "pagenum": 0,
        "pagesize": 5,
        "result": [
          {
            "cat_id": 1,
            "cat_name": "大家电",
            "cat_pid": 0,
            "cat_level": 0,
            "cat_deleted": false,
            "children": [
              {
                "cat_id": 3,
                "cat_name": "电视",
                "cat_pid": 1,
                "cat_level": 1,
                "cat_deleted": false,
                "children": [
                  {
                    "cat_id": 6,
                    "cat_name": "曲面电视",
                    "cat_pid": 3,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 7,
                    "cat_name": "海信",
                    "cat_pid": 3,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 8,
                    "cat_name": "夏普",
                    "cat_pid": 3,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 9,
                    "cat_name": "创维",
                    "cat_pid": 3,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 10,
                    "cat_name": "TCL",
                    "cat_pid": 3,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 11,
                    "cat_name": "PPTV",
                    "cat_pid": 3,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 12,
                    "cat_name": "小米",
                    "cat_pid": 3,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 13,
                    "cat_name": "长虹",
                    "cat_pid": 3,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 14,
                    "cat_name": "康佳",
                    "cat_pid": 3,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 15,
                    "cat_name": "三星",
                    "cat_pid": 3,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 16,
                    "cat_name": "飞利浦",
                    "cat_pid": 3,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 17,
                    "cat_name": "索尼",
                    "cat_pid": 3,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 18,
                    "cat_name": "先锋",
                    "cat_pid": 3,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 19,
                    "cat_name": "家庭影院",
                    "cat_pid": 3,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 20,
                    "cat_name": "音响",
                    "cat_pid": 3,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 21,
                    "cat_name": "盒子",
                    "cat_pid": 3,
                    "cat_level": 2,
                    "cat_deleted": false
                  }
                ]
              },
              {
                "cat_id": 4,
                "cat_name": "空调",
                "cat_pid": 1,
                "cat_level": 1,
                "cat_deleted": false,
                "children": [
                  {
                    "cat_id": 23,
                    "cat_name": "变频空调",
                    "cat_pid": 4,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 24,
                    "cat_name": "立柜空调",
                    "cat_pid": 4,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 25,
                    "cat_name": "挂壁空调",
                    "cat_pid": 4,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 27,
                    "cat_name": "中央空调",
                    "cat_pid": 4,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 28,
                    "cat_name": "移动空调",
                    "cat_pid": 4,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 29,
                    "cat_name": "海尔",
                    "cat_pid": 4,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 30,
                    "cat_name": "三菱重工",
                    "cat_pid": 4,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 31,
                    "cat_name": "志高",
                    "cat_pid": 4,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 32,
                    "cat_name": "奥克斯",
                    "cat_pid": 4,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 33,
                    "cat_name": "长虹",
                    "cat_pid": 4,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 34,
                    "cat_name": "科龙",
                    "cat_pid": 4,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 35,
                    "cat_name": "海信",
                    "cat_pid": 4,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 36,
                    "cat_name": "惠而浦",
                    "cat_pid": 4,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 37,
                    "cat_name": "空调清洗",
                    "cat_pid": 4,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 38,
                    "cat_name": "空调维修",
                    "cat_pid": 4,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 39,
                    "cat_name": "空调安装",
                    "cat_pid": 4,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 40,
                    "cat_name": "空调回收",
                    "cat_pid": 4,
                    "cat_level": 2,
                    "cat_deleted": false
                  }
                ]
              },
              {
                "cat_id": 26,
                "cat_name": "洗衣机",
                "cat_pid": 1,
                "cat_level": 1,
                "cat_deleted": false,
                "children": [
                  {
                    "cat_id": 42,
                    "cat_name": "洗衣机",
                    "cat_pid": 26,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 43,
                    "cat_name": "滚筒洗衣机",
                    "cat_pid": 26,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 44,
                    "cat_name": "波轮洗衣机",
                    "cat_pid": 26,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 46,
                    "cat_name": "大容量洗衣机",
                    "cat_pid": 26,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 47,
                    "cat_name": "迷你洗衣机",
                    "cat_pid": 26,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 48,
                    "cat_name": "双缸洗衣机",
                    "cat_pid": 26,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 49,
                    "cat_name": "干衣机",
                    "cat_pid": 26,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 50,
                    "cat_name": "洗衣机服务",
                    "cat_pid": 26,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 51,
                    "cat_name": "西门子",
                    "cat_pid": 26,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 53,
                    "cat_name": "海尔",
                    "cat_pid": 26,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 54,
                    "cat_name": "小天鹅",
                    "cat_pid": 26,
                    "cat_level": 2,
                    "cat_deleted": false
                  }
                ]
              },
              {
                "cat_id": 45,
                "cat_name": "冰箱",
                "cat_pid": 1,
                "cat_level": 1,
                "cat_deleted": false,
                "children": [
                  {
                    "cat_id": 56,
                    "cat_name": "对开门冰箱",
                    "cat_pid": 45,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 58,
                    "cat_name": "多门冰箱",
                    "cat_pid": 45,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 59,
                    "cat_name": "三门冰箱",
                    "cat_pid": 45,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 60,
                    "cat_name": "十字对开门",
                    "cat_pid": 45,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 61,
                    "cat_name": "双门冰箱",
                    "cat_pid": 45,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 62,
                    "cat_name": "冷柜/冰吧",
                    "cat_pid": 45,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 63,
                    "cat_name": "商用冷柜",
                    "cat_pid": 45,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 65,
                    "cat_name": "海尔",
                    "cat_pid": 45,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 66,
                    "cat_name": "西门子",
                    "cat_pid": 45,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 67,
                    "cat_name": "容声",
                    "cat_pid": 45,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 68,
                    "cat_name": "美菱",
                    "cat_pid": 45,
                    "cat_level": 2,
                    "cat_deleted": false
                  }
                ]
              }
            ]
          },
          {
            "cat_id": 52,
            "cat_name": "热门推荐",
            "cat_pid": 0,
            "cat_level": 0,
            "cat_deleted": false,
            "children": [
              {
                "cat_id": 64,
                "cat_name": "圣诞狂欢",
                "cat_pid": 52,
                "cat_level": 1,
                "cat_deleted": false,
                "children": [
                  {
                    "cat_id": 73,
                    "cat_name": "护肤套装",
                    "cat_pid": 64,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 74,
                    "cat_name": "面膜",
                    "cat_pid": 64,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 76,
                    "cat_name": "巧克力",
                    "cat_pid": 64,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 77,
                    "cat_name": "儿童玩具",
                    "cat_pid": 64,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 78,
                    "cat_name": "童装童鞋",
                    "cat_pid": 64,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 79,
                    "cat_name": "平板电脑",
                    "cat_pid": 64,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 80,
                    "cat_name": "笔记本",
                    "cat_pid": 64,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 81,
                    "cat_name": "苹果手机",
                    "cat_pid": 64,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 82,
                    "cat_name": "小米手机",
                    "cat_pid": 64,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 83,
                    "cat_name": "数码相机",
                    "cat_pid": 64,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 84,
                    "cat_name": "耳机耳麦",
                    "cat_pid": 64,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 85,
                    "cat_name": "挂机空调",
                    "cat_pid": 64,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 86,
                    "cat_name": "空气净化器",
                    "cat_pid": 64,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 87,
                    "cat_name": "洗衣机",
                    "cat_pid": 64,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 88,
                    "cat_name": "4K超高清",
                    "cat_pid": 64,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 89,
                    "cat_name": "洗碗机",
                    "cat_pid": 64,
                    "cat_level": 2,
                    "cat_deleted": false
                  }
                ]
              },
              {
                "cat_id": 1008,
                "cat_name": "冲锋衣",
                "cat_pid": 52,
                "cat_level": 2,
                "cat_deleted": false
              }
            ]
          },
          {
            "cat_id": 70,
            "cat_name": "海外购",
            "cat_pid": 0,
            "cat_level": 0,
            "cat_deleted": false,
            "children": [
              {
                "cat_id": 75,
                "cat_name": "国际名牌",
                "cat_pid": 70,
                "cat_level": 1,
                "cat_deleted": false,
                "children": [
                  {
                    "cat_id": 92,
                    "cat_name": "swisse",
                    "cat_pid": 75,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 94,
                    "cat_name": "巴黎水",
                    "cat_pid": 75,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 95,
                    "cat_name": "爱他美",
                    "cat_pid": 75,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 97,
                    "cat_name": "花王",
                    "cat_pid": 75,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 98,
                    "cat_name": "戴森",
                    "cat_pid": 75,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 99,
                    "cat_name": "ReFa",
                    "cat_pid": 75,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 100,
                    "cat_name": "MK",
                    "cat_pid": 75,
                    "cat_level": 2,
                    "cat_deleted": false
                  }
                ]
              },
              {
                "cat_id": 93,
                "cat_name": "母婴儿童",
                "cat_pid": 70,
                "cat_level": 1,
                "cat_deleted": false,
                "children": [
                  {
                    "cat_id": 102,
                    "cat_name": "纸尿裤",
                    "cat_pid": 93,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 103,
                    "cat_name": "营养辅食",
                    "cat_pid": 93,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 104,
                    "cat_name": "婴儿用品",
                    "cat_pid": 93,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 105,
                    "cat_name": "婴儿洗护",
                    "cat_pid": 93,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 106,
                    "cat_name": "童车童床",
                    "cat_pid": 93,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 107,
                    "cat_name": "儿童玩具",
                    "cat_pid": 93,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 108,
                    "cat_name": "童装童鞋",
                    "cat_pid": 93,
                    "cat_level": 2,
                    "cat_deleted": false
                  }
                ]
              },
              {
                "cat_id": 96,
                "cat_name": "美妆",
                "cat_pid": 70,
                "cat_level": 1,
                "cat_deleted": false,
                "children": [
                  {
                    "cat_id": 110,
                    "cat_name": "面膜",
                    "cat_pid": 96,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 111,
                    "cat_name": "口红",
                    "cat_pid": 96,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 112,
                    "cat_name": "彩妆",
                    "cat_pid": 96,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 114,
                    "cat_name": "护肤套装",
                    "cat_pid": 96,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 116,
                    "cat_name": "香水香氛",
                    "cat_pid": 96,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 117,
                    "cat_name": "洁面仪",
                    "cat_pid": 96,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 118,
                    "cat_name": "卸妆",
                    "cat_pid": 96,
                    "cat_level": 2,
                    "cat_deleted": false
                  }
                ]
              },
              {
                "cat_id": 113,
                "cat_name": "个护",
                "cat_pid": 70,
                "cat_level": 1,
                "cat_deleted": false,
                "children": [
                  {
                    "cat_id": 120,
                    "cat_name": "美发护发",
                    "cat_pid": 113,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 121,
                    "cat_name": "美甲",
                    "cat_pid": 113,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 122,
                    "cat_name": "口腔护理",
                    "cat_pid": 113,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 123,
                    "cat_name": "女性护理",
                    "cat_pid": 113,
                    "cat_level": 2,
                    "cat_deleted": false
                  }
                ]
              },
              {
                "cat_id": 115,
                "cat_name": "营养保健",
                "cat_pid": 70,
                "cat_level": 1,
                "cat_deleted": false,
                "children": [
                  {
                    "cat_id": 125,
                    "cat_name": "提高免疫",
                    "cat_pid": 115,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 126,
                    "cat_name": "维生素/矿物质",
                    "cat_pid": 115,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 127,
                    "cat_name": "美容养颜",
                    "cat_pid": 115,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 129,
                    "cat_name": "调节三高",
                    "cat_pid": 115,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 130,
                    "cat_name": "减肥瘦身",
                    "cat_pid": 115,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 131,
                    "cat_name": "胶原蛋白",
                    "cat_pid": 115,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 132,
                    "cat_name": "补肾强身",
                    "cat_pid": 115,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 134,
                    "cat_name": "养生茶饮",
                    "cat_pid": 115,
                    "cat_level": 2,
                    "cat_deleted": false
                  }
                ]
              },
              {
                "cat_id": 128,
                "cat_name": "食品",
                "cat_pid": 70,
                "cat_level": 1,
                "cat_deleted": false,
                "children": [
                  {
                    "cat_id": 136,
                    "cat_name": "牛奶乳品",
                    "cat_pid": 128,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 137,
                    "cat_name": "方便速食",
                    "cat_pid": 128,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 138,
                    "cat_name": "进口酒水",
                    "cat_pid": 128,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 139,
                    "cat_name": "进口粮油",
                    "cat_pid": 128,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 140,
                    "cat_name": "厨房调料",
                    "cat_pid": 128,
                    "cat_level": 2,
                    "cat_deleted": false
                  }
                ]
              },
              {
                "cat_id": 133,
                "cat_name": "数码家电",
                "cat_pid": 70,
                "cat_level": 1,
                "cat_deleted": false,
                "children": [
                  {
                    "cat_id": 142,
                    "cat_name": "平板电脑",
                    "cat_pid": 133,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 143,
                    "cat_name": "笔记本电脑",
                    "cat_pid": 133,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 144,
                    "cat_name": "手机配件",
                    "cat_pid": 133,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 145,
                    "cat_name": "音箱音响",
                    "cat_pid": 133,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 146,
                    "cat_name": "摄影摄像",
                    "cat_pid": 133,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 147,
                    "cat_name": "智能设备",
                    "cat_pid": 133,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 148,
                    "cat_name": "剃须刀",
                    "cat_pid": 133,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 149,
                    "cat_name": "吸尘器",
                    "cat_pid": 133,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 150,
                    "cat_name": "电饭煲",
                    "cat_pid": 133,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 152,
                    "cat_name": "电吹风",
                    "cat_pid": 133,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 153,
                    "cat_name": "咖啡机",
                    "cat_pid": 133,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 154,
                    "cat_name": "空气净化器",
                    "cat_pid": 133,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 155,
                    "cat_name": "美容仪",
                    "cat_pid": 133,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 156,
                    "cat_name": "电动牙刷",
                    "cat_pid": 133,
                    "cat_level": 2,
                    "cat_deleted": false
                  }
                ]
              },
              {
                "cat_id": 151,
                "cat_name": "服饰箱包",
                "cat_pid": 70,
                "cat_level": 1,
                "cat_deleted": false,
                "children": [
                  {
                    "cat_id": 159,
                    "cat_name": "潮流女包",
                    "cat_pid": 151,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 160,
                    "cat_name": "钟表眼镜",
                    "cat_pid": 151,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 161,
                    "cat_name": "男装",
                    "cat_pid": 151,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 162,
                    "cat_name": "女装",
                    "cat_pid": 151,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 163,
                    "cat_name": "配饰",
                    "cat_pid": 151,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 164,
                    "cat_name": "男鞋",
                    "cat_pid": 151,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 165,
                    "cat_name": "女鞋",
                    "cat_pid": 151,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 166,
                    "cat_name": "运动鞋",
                    "cat_pid": 151,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 167,
                    "cat_name": "功能箱包",
                    "cat_pid": 151,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 168,
                    "cat_name": "珠宝饰品",
                    "cat_pid": 151,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 169,
                    "cat_name": "内衣",
                    "cat_pid": 151,
                    "cat_level": 2,
                    "cat_deleted": false
                  }
                ]
              },
              {
                "cat_id": 157,
                "cat_name": "家居日用",
                "cat_pid": 70,
                "cat_level": 1,
                "cat_deleted": false,
                "children": [
                  {
                    "cat_id": 171,
                    "cat_name": "生活日用",
                    "cat_pid": 157,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 175,
                    "cat_name": "餐厨用具",
                    "cat_pid": 157,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 177,
                    "cat_name": "清洁用品",
                    "cat_pid": 157,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 179,
                    "cat_name": "安全避孕",
                    "cat_pid": 157,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 180,
                    "cat_name": "情趣用品",
                    "cat_pid": 157,
                    "cat_level": 2,
                    "cat_deleted": false
                  }
                ]
              }
            ]
          },
          {
            "cat_id": 172,
            "cat_name": "苏宁房产",
            "cat_pid": 0,
            "cat_level": 0,
            "cat_deleted": false,
            "children": [
              {
                "cat_id": 173,
                "cat_name": "苏宁房产",
                "cat_pid": 172,
                "cat_level": 1,
                "cat_deleted": false,
                "children": [
                  {
                    "cat_id": 183,
                    "cat_name": "恒大旅游",
                    "cat_pid": 173,
                    "cat_level": 2,
                    "cat_deleted": false
                  }
                ]
              },
              {
                "cat_id": 181,
                "cat_name": "苏宁置业",
                "cat_pid": 172,
                "cat_level": 2,
                "cat_deleted": false
              }
            ]
          },
          {
            "cat_id": 174,
            "cat_name": "手机相机",
            "cat_pid": 0,
            "cat_level": 0,
            "cat_deleted": false,
            "children": [
              {
                "cat_id": 178,
                "cat_name": "大牌推荐",
                "cat_pid": 174,
                "cat_level": 1,
                "cat_deleted": false,
                "children": [
                  {
                    "cat_id": 187,
                    "cat_name": "荣耀",
                    "cat_pid": 178,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 188,
                    "cat_name": "华为",
                    "cat_pid": 178,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 189,
                    "cat_name": "三星",
                    "cat_pid": 178,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 190,
                    "cat_name": "魅族",
                    "cat_pid": 178,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 191,
                    "cat_name": "OPPO",
                    "cat_pid": 178,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 192,
                    "cat_name": "vivo",
                    "cat_pid": 178,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 193,
                    "cat_name": "努比亚",
                    "cat_pid": 178,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 194,
                    "cat_name": "美图",
                    "cat_pid": 178,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 195,
                    "cat_name": "诺基亚",
                    "cat_pid": 178,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 196,
                    "cat_name": "飞利浦",
                    "cat_pid": 178,
                    "cat_level": 2,
                    "cat_deleted": false
                  }
                ]
              },
              {
                "cat_id": 185,
                "cat_name": "搞机达人",
                "cat_pid": 174,
                "cat_level": 1,
                "cat_deleted": false,
                "children": [
                  {
                    "cat_id": 198,
                    "cat_name": "拍照手机",
                    "cat_pid": 185,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 200,
                    "cat_name": "游戏手机",
                    "cat_pid": 185,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 201,
                    "cat_name": "好评过万",
                    "cat_pid": 185,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 202,
                    "cat_name": "全面屏手机",
                    "cat_pid": 185,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 203,
                    "cat_name": "大屏手机",
                    "cat_pid": 185,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 204,
                    "cat_name": "老人机",
                    "cat_pid": 185,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 205,
                    "cat_name": "长续航手机",
                    "cat_pid": 185,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 206,
                    "cat_name": "指纹手机",
                    "cat_pid": 185,
                    "cat_level": 2,
                    "cat_deleted": false
                  }
                ]
              },
              {
                "cat_id": 199,
                "cat_name": "手机配件",
                "cat_pid": 174,
                "cat_level": 1,
                "cat_deleted": false,
                "children": [
                  {
                    "cat_id": 209,
                    "cat_name": "移动电源",
                    "cat_pid": 199,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 210,
                    "cat_name": "苹果周边",
                    "cat_pid": 199,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 212,
                    "cat_name": "手机耳机",
                    "cat_pid": 199,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 213,
                    "cat_name": "充电器",
                    "cat_pid": 199,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 214,
                    "cat_name": "手机膜",
                    "cat_pid": 199,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 215,
                    "cat_name": "数据线",
                    "cat_pid": 199,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 216,
                    "cat_name": "手机存储卡",
                    "cat_pid": 199,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 217,
                    "cat_name": "手机壳",
                    "cat_pid": 199,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 218,
                    "cat_name": "自拍杆",
                    "cat_pid": 199,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 219,
                    "cat_name": "手机支架",
                    "cat_pid": 199,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 220,
                    "cat_name": "手机U盘",
                    "cat_pid": 199,
                    "cat_level": 2,
                    "cat_deleted": false
                  }
                ]
              },
              {
                "cat_id": 207,
                "cat_name": "手机服务",
                "cat_pid": 174,
                "cat_level": 1,
                "cat_deleted": false,
                "children": [
                  {
                    "cat_id": 222,
                    "cat_name": "手机维修",
                    "cat_pid": 207,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 224,
                    "cat_name": "二手优品",
                    "cat_pid": 207,
                    "cat_level": 2,
                    "cat_deleted": false
                  }
                ]
              },
              {
                "cat_id": 211,
                "cat_name": "运营商",
                "cat_pid": 174,
                "cat_level": 1,
                "cat_deleted": false,
                "children": [
                  {
                    "cat_id": 226,
                    "cat_name": "话费充值",
                    "cat_pid": 211,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 227,
                    "cat_name": "流量订购",
                    "cat_pid": 211,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 228,
                    "cat_name": "苏宁网厅",
                    "cat_pid": 211,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 229,
                    "cat_name": "超值靓号",
                    "cat_pid": 211,
                    "cat_level": 2,
                    "cat_deleted": false
                  }
                ]
              },
              {
                "cat_id": 223,
                "cat_name": "摄影摄像",
                "cat_pid": 174,
                "cat_level": 1,
                "cat_deleted": false,
                "children": [
                  {
                    "cat_id": 231,
                    "cat_name": "微单相机",
                    "cat_pid": 223,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 232,
                    "cat_name": "数码相机",
                    "cat_pid": 223,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 233,
                    "cat_name": "摄像机",
                    "cat_pid": 223,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 234,
                    "cat_name": "航拍无人机",
                    "cat_pid": 223,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 235,
                    "cat_name": "镜头",
                    "cat_pid": 223,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 236,
                    "cat_name": "拍立得",
                    "cat_pid": 223,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 237,
                    "cat_name": "运动相机",
                    "cat_pid": 223,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 238,
                    "cat_name": "佳能",
                    "cat_pid": 223,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 239,
                    "cat_name": "尼康",
                    "cat_pid": 223,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 240,
                    "cat_name": "索尼",
                    "cat_pid": 223,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 241,
                    "cat_name": "富士",
                    "cat_pid": 223,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 242,
                    "cat_name": "JVC",
                    "cat_pid": 223,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 243,
                    "cat_name": "宾得",
                    "cat_pid": 223,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 244,
                    "cat_name": "奥林巴斯",
                    "cat_pid": 223,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 245,
                    "cat_name": "柯达",
                    "cat_pid": 223,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 247,
                    "cat_name": "徕卡",
                    "cat_pid": 223,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 248,
                    "cat_name": "松下",
                    "cat_pid": 223,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 249,
                    "cat_name": "喜爱",
                    "cat_pid": 223,
                    "cat_level": 2,
                    "cat_deleted": false
                  }
                ]
              },
              {
                "cat_id": 246,
                "cat_name": "相机配件",
                "cat_pid": 174,
                "cat_level": 1,
                "cat_deleted": false,
                "children": [
                  {
                    "cat_id": 251,
                    "cat_name": "三脚架",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 252,
                    "cat_name": "数据线",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 253,
                    "cat_name": "滤镜",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 254,
                    "cat_name": "相机存储卡",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 255,
                    "cat_name": "闪光灯",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 256,
                    "cat_name": "三星",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 257,
                    "cat_name": "影棚器材",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 258,
                    "cat_name": "国家地理",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 259,
                    "cat_name": "腾龙",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 260,
                    "cat_name": "适马",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 261,
                    "cat_name": "英特迈",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 262,
                    "cat_name": "品胜",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 263,
                    "cat_name": "百诺",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 264,
                    "cat_name": "金士顿",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 265,
                    "cat_name": "闪迪",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 266,
                    "cat_name": "肯高",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 267,
                    "cat_name": "曼富图",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 268,
                    "cat_name": "卡色",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 269,
                    "cat_name": "神牛",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 272,
                    "cat_name": "思锐",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 274,
                    "cat_name": "施耐德",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 275,
                    "cat_name": "金贝",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 276,
                    "cat_name": "飞毛腿",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 277,
                    "cat_name": "耐司",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 278,
                    "cat_name": "沣标",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 279,
                    "cat_name": "迪比科",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  },
                  {
                    "cat_id": 280,
                    "cat_name": "斯丹德",
                    "cat_pid": 246,
                    "cat_level": 2,
                    "cat_deleted": false
                  }
                ]
              }
            ]
          }
        ]
      },
      "meta": {
        "msg": "获取成功",
        "status": 200
      }
    });
  }
});
router.post(cate_url,(req, res) => {
  res.json({
    "data": {
      "cat_id": 62,
      "cat_name": "相框",
      "cat_pid": "1",
      "cat_level": "1"
    },
    "meta": {
      "msg": "创建成功",
      "status": 201
    }
  });
});
router.delete(cate_url+'/:id',(req, res) => {
  res.json({
    "data": null,
    "meta": {
      "msg": "删除成功",
      "status": 200
    }
  });
});
router.get(cate_url+'/:id',(req, res) => {
  res.json({
    "data": {
      "cat_id": 1,
      "cat_name": "大家电",
      "cat_pid": 0,
      "cat_level": 0,
      "cat_deleted": false
    },
    "meta": {
      "msg": "获取成功",
      "status": 200
    }
  });
});
router.put(cate_url+'/:id',(req, res) => {
res.json({
  "data": {
    "cat_id": 22,
    "cat_name": "自拍杆",
    "cat_pid": 7,
    "cat_level": 2
  },
  "meta": {
    "msg": "更新成功",
    "status": 200
  }
});
});
const params_url = baseURL + 'categories/:id/attributes';
router.get(params_url,(req, res) => {
  if (req.query.sel === 'many') {
    res.json({
      "data": [
        {
          "attr_id": 3077,
          "attr_name": "版式",
          "cat_id": 6,
          "attr_sel": "many",
          "attr_write": "list",
          "attr_vals": "49吋4K超薄曲面 人工智能,55吋4K观影曲面 30核HDR,55吋4K超薄曲面 人工智能,65吋4K超薄曲面 人工智能",
          "delete_time": null
        },
        {
          "attr_id": 3805,
          "attr_name": "颜色",
          "cat_id": 6,
          "attr_sel": "many",
          "attr_write": "list",
          "attr_vals": "白色",
          "delete_time": null
        }
      ],
      "meta": {
        "msg": "获取成功",
        "status": 200
      }
    });
  }else {
    res.json({
      "data": [
        {
          "attr_id": 3068,
          "attr_name": "主体-商品名称",
          "cat_id": 6,
          "attr_sel": "only",
          "attr_write": "manual",
          "attr_vals": "TCL电视 55A950C",
          "delete_time": null
        },
        {
          "attr_id": 3069,
          "attr_name": "显示-曲面",
          "cat_id": 6,
          "attr_sel": "only",
          "attr_write": "manual",
          "attr_vals": "是",
          "delete_time": null
        },
        {
          "attr_id": 3070,
          "attr_name": "系统-智能电视",
          "cat_id": 6,
          "attr_sel": "only",
          "attr_write": "manual",
          "attr_vals": "智能电视",
          "delete_time": null
        },
        {
          "attr_id": 3071,
          "attr_name": "外观-壁挂安装",
          "cat_id": 6,
          "attr_sel": "only",
          "attr_write": "manual",
          "attr_vals": "支持",
          "delete_time": null
        },
        {
          "attr_id": 3072,
          "attr_name": "功耗-整机功率（W）",
          "cat_id": 6,
          "attr_sel": "only",
          "attr_write": "manual",
          "attr_vals": "120瓦特",
          "delete_time": null
        },
        {
          "attr_id": 3073,
          "attr_name": "端口-模拟RF接口",
          "cat_id": 6,
          "attr_sel": "only",
          "attr_write": "manual",
          "attr_vals": "有",
          "delete_time": null
        },
        {
          "attr_id": 3074,
          "attr_name": "音频-扬声器数量",
          "cat_id": 6,
          "attr_sel": "only",
          "attr_write": "manual",
          "attr_vals": "2个",
          "delete_time": null
        },
        {
          "attr_id": 3075,
          "attr_name": "交互设备-无线键鼠",
          "cat_id": 6,
          "attr_sel": "only",
          "attr_write": "manual",
          "attr_vals": "支持",
          "delete_time": null
        },
        {
          "attr_id": 3076,
          "attr_name": "互联互通-多屏互动",
          "cat_id": 6,
          "attr_sel": "only",
          "attr_write": "manual",
          "attr_vals": "支持",
          "delete_time": null
        }
      ],
      "meta": {
        "msg": "获取成功",
        "status": 200
      }
    });
  }
});
router.post(params_url,(req, res) => {
  res.json({
    "data": {
      "attr_id": 44,
      "attr_name": "测试参数",
      "cat_id": "1",
      "attr_sel": "many",
      "attr_write": "list",
      "attr_vals": "a,b,c"
    },
    "meta": {
      "msg": "创建成功",
      "status": 201
    }
  });
});
router.delete(params_url+'/:attr_id',(req, res) => {
  res.json({
    "data": null,
    "meta": {
      "msg": "删除成功",
      "status": 200
    }
  });
});
router.get(params_url+'/:attr_id',(req, res) => {
  res.json({
    "data": {
      "attr_id": 1,
      "attr_name": "cpu",
      "cat_id": 22,
      "attr_sel": "only",
      "attr_write": "manual",
      "attr_vals": "ffff"
    },
    "meta": {
      "msg": "获取成功",
      "status": 200
    }
  });
});
router.put(params_url+'/:attr_id',(req, res) => {
  res.json({
    "data": {
      "attr_id": 9,
      "attr_name": "测试更新",
      "cat_id": "43",
      "attr_sel": "only",
      "attr_write": "manual",
      "attr_vals": "abc"
    },
    "meta": {
      "msg": "更新成功",
      "status": 200
    }
  });
});
module.exports = router;
